﻿#ifndef LK_ISERIALIZEABLE_
#define LK_ISERIALIZEABLE_
namespace LK
{
	struct ISerializeable: virtual Object
	{
		typedef ptr<ISerializeable> PObj;
		typedef ISerializeable IObj;
		/*动态获取类型信息*/
		virtual ptr<Type> GetType()const;
		/*operator&重载*/
		IObj*operator&() { Object::operator&(); return this; }
		IObj const*operator&()const { Object::operator&(); return this; }
		virtual void SwapWith(Object&) { Throw<PNotSupportException >(); }
		//返回一个序列化字节数组
		virtual PByteArray Serialize()const;
		/**@brief 从一个序列化数组构造指定路径名的对象*/
		static PObject Deserialize(PByteArray dat,PString classPath);
		/**
		@brif 添加类型信息*/
		static void AddTypeInfo();
	};
}
#endif